package com.example.guessthesoundtrack;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.Paint.Align;
import android.view.MotionEvent;

public abstract class Dialog {
	private Bitmap clicked, unclicked;
	private Paint paint;
	private Rect rect;
	
	private String message;
	private boolean visible;
	private float x, y, width, height;
	
	public Dialog(Bitmap clicked, Bitmap unclicked, Rect rect, String message, float x, float y, float width, float height) {
		this.clicked = clicked;
		this.unclicked = unclicked;
		this.rect = rect;
		this.message = message;
		this.width = width;
		this.height = height;
		this.x = x;
		this.y = y;
		this.visible = false;
		
		this.paint = new Paint();
		this.paint.setTextSize(32f);
		this.paint.setTextAlign(Align.CENTER);
		this.paint.setColor(Color.BLACK);
	}

	public Bitmap getClicked() {
		return clicked;
	}

	public void setClicked(Bitmap clicked) {
		this.clicked = clicked;
	}

	public Bitmap getUnclicked() {
		return unclicked;
	}

	public void setUnclicked(Bitmap unclicked) {
		this.unclicked = unclicked;
	}

	public Paint getPaint() {
		return paint;
	}

	public void setPaint(Paint paint) {
		this.paint = paint;
	}
	
	public Rect getRect() {
		return rect;
	}

	public void setRect(Rect rect) {
		this.rect = rect;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public float getX() {
		return x;
	}

	public void setX(float x) {
		this.x = x;
	}

	public float getY() {
		return y;
	}

	public void setY(float y) {
		this.y = y;
	}

	public float getWidth() {
		return width;
	}

	public void setWidth(float width) {
		this.width = width;
	}

	public float getHeight() {
		return height;
	}

	public void setHeight(float height) {
		this.height = height;
	}
	
	public void show() {
		visible = true;
	}
	
	public void dismiss() {
		visible = false;
	}
	
	public abstract void draw(Canvas canvas);
	
	public abstract void update(int delta);
	
	public abstract void onClick(MotionEvent event, float x, float y);
	
	public abstract void onDestroy();
}
